package com.smile.config;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;

public class NacosMetadataEnvironmentPostProcessor implements EnvironmentPostProcessor {
    @Override
    public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
//        String contextPath = environment.getProperty("server.servlet.context-path", "");
        System.setProperty("spring.cloud.nacos.discovery.metadata.route.enable", "true");
        System.setProperty("spring.cloud.nacos.discovery.metadata.route.prefix", "1");
//        System.setProperty("spring.cloud.nacos.discovery.metadata.route.path", contextPath);
    }
}